const cameraDao = require('../../dao/web/CameraDao');
module.exports = {
    getCamerasService: function (req, res) {
        return cameraDao.getCamerasDao(req, req.query)
    },
    startRTSPStreamService: function (app, req) {
        const config = {
            name: req.body.name,
            username: req.body.username,
            password: req.body.password,
            host: req.body.host,
            port: 554,
            wsPort: req.body.wsPort || 9999,
        }
        return cameraDao.startRTSPStreamDao(app, req, config)
    },
    closeRTSPStreamService: function (app, req) {
        return cameraDao.closeRTSPStreamDao(app, req, req.body.name)
    },
    snapshotRTSPStreamService: function (app, req) {
        return cameraDao.snapshotRTSPStreamDao(app, req, req.body)
    },
    recordRTSPStreamService: function (app, req) {
        return cameraDao.recordRTSPStreamDao(app, req, req.body)
    }
}